 <?php

/**
 * Description of stdLoginStrategy
 *
 * @author ������
 */
class SteamLoginStrategy extends LoginStrategy {

    public function doLogin(User $user, $auth_data) {

        $openid = new LightOpenID('http://localhost/pleasure');
        
        $data = $user->model->getUserDataByLogin($auth_data['login']);
        if(!$data)
        {
            $auth_data['password'] = "somepswrd";
            
            if(!$user->doRegistration($auth_data))
            {
                return false;
            }
            else
            {
                $data = $user->model->getUserDataByLogin($auth_data['login']);
            }
        }
        if ($openid->mode && $openid->validate()) {
            return $this->_makeLogin($user, $data);
        } else {
            return false;
        }
    }

}

?>
